<template>
    <van-popup v-model:show="visible" position="bottom" :style="{ height: '60%' }" round>
        <!-- 使用 Vant Picker 级联选择实现省市区联动 -->
        <van-picker v-model="selectedValues" :columns="columns" title="选择出生地区" @change="onPickerChange"
            @confirm="onPickerConfirm" @cancel="onPickerCancel" />
    </van-popup>
</template>

<script setup lang="ts">
import { ref, watch, computed } from 'vue'

// Props
interface Props {
    modelValue: boolean
    defaultRegion?: string
}

const props = withDefaults(defineProps<Props>(), {
    modelValue: false,
    defaultRegion: ''
})

// Emits
const emit = defineEmits<{
    'update:modelValue': [value: boolean]
    'confirm': [region: string]
}>()

// 响应式数据
const visible = computed({
    get: () => props.modelValue,
    set: (value) => emit('update:modelValue', value)
})

// 选中的值
const selectedValues = ref<string[]>([])

// 省市区级联数据
const columns = ref([
    {
        text: '北京市',
        value: '110000',
        children: [
            {
                text: '北京市',
                value: '110100',
                children: [
                    { text: '东城区', value: '110101' },
                    { text: '西城区', value: '110102' },
                    { text: '朝阳区', value: '110105' },
                    { text: '丰台区', value: '110106' },
                    { text: '石景山区', value: '110107' },
                    { text: '海淀区', value: '110108' },
                    { text: '门头沟区', value: '110109' },
                    { text: '房山区', value: '110111' },
                    { text: '通州区', value: '110112' },
                    { text: '顺义区', value: '110113' },
                    { text: '昌平区', value: '110114' },
                    { text: '大兴区', value: '110115' },
                    { text: '怀柔区', value: '110116' },
                    { text: '平谷区', value: '110117' },
                    { text: '密云区', value: '110118' },
                    { text: '延庆区', value: '110119' }
                ]
            }
        ]
    },
    {
        text: '天津市',
        value: '120000',
        children: [
            {
                text: '天津市',
                value: '120100',
                children: [
                    { text: '和平区', value: '120101' },
                    { text: '河东区', value: '120102' },
                    { text: '河西区', value: '120103' },
                    { text: '南开区', value: '120104' },
                    { text: '河北区', value: '120105' },
                    { text: '红桥区', value: '120106' },
                    { text: '东丽区', value: '120110' },
                    { text: '西青区', value: '120111' },
                    { text: '津南区', value: '120112' },
                    { text: '北辰区', value: '120113' },
                    { text: '武清区', value: '120114' },
                    { text: '宝坻区', value: '120115' },
                    { text: '滨海新区', value: '120116' },
                    { text: '宁河区', value: '120117' },
                    { text: '静海区', value: '120118' },
                    { text: '蓟州区', value: '120119' }
                ]
            }
        ]
    },
    {
        text: '河北省',
        value: '130000',
        children: [
            {
                text: '石家庄市',
                value: '130100',
                children: [
                    { text: '长安区', value: '130102' },
                    { text: '桥西区', value: '130104' },
                    { text: '新华区', value: '130105' },
                    { text: '井陉矿区', value: '130107' },
                    { text: '裕华区', value: '130108' },
                    { text: '藁城区', value: '130109' },
                    { text: '鹿泉区', value: '130110' },
                    { text: '栾城区', value: '130111' }
                ]
            },
            {
                text: '唐山市',
                value: '130200',
                children: [
                    { text: '路南区', value: '130202' },
                    { text: '路北区', value: '130203' },
                    { text: '古冶区', value: '130204' },
                    { text: '开平区', value: '130205' },
                    { text: '丰南区', value: '130207' },
                    { text: '丰润区', value: '130208' },
                    { text: '曹妃甸区', value: '130209' }
                ]
            },
            {
                text: '秦皇岛市',
                value: '130300',
                children: [
                    { text: '海港区', value: '130302' },
                    { text: '山海关区', value: '130303' },
                    { text: '北戴河区', value: '130304' },
                    { text: '抚宁区', value: '130306' }
                ]
            },
            {
                text: '邯郸市',
                value: '130400',
                children: [
                    { text: '邯山区', value: '130402' },
                    { text: '丛台区', value: '130403' },
                    { text: '复兴区', value: '130404' },
                    { text: '峰峰矿区', value: '130406' },
                    { text: '肥乡区', value: '130407' },
                    { text: '永年区', value: '130408' }
                ]
            },
            {
                text: '邢台市',
                value: '130500',
                children: [
                    { text: '襄都区', value: '130502' },
                    { text: '信都区', value: '130503' },
                    { text: '任泽区', value: '130505' },
                    { text: '南和区', value: '130506' }
                ]
            },
            {
                text: '保定市',
                value: '130600',
                children: [
                    { text: '竞秀区', value: '130602' },
                    { text: '莲池区', value: '130606' },
                    { text: '满城区', value: '130607' },
                    { text: '清苑区', value: '130608' },
                    { text: '徐水区', value: '130609' }
                ]
            },
            {
                text: '张家口市',
                value: '130700',
                children: [
                    { text: '桥东区', value: '130702' },
                    { text: '桥西区', value: '130703' },
                    { text: '宣化区', value: '130705' },
                    { text: '下花园区', value: '130706' },
                    { text: '万全区', value: '130708' },
                    { text: '崇礼区', value: '130709' }
                ]
            },
            {
                text: '承德市',
                value: '130800',
                children: [
                    { text: '双桥区', value: '130802' },
                    { text: '双滦区', value: '130803' },
                    { text: '鹰手营子矿区', value: '130804' },
                    { text: '丰南区', value: '130805' }
                ]
            },
            {
                text: '沧州市',
                value: '130900',
                children: [
                    { text: '新华区', value: '130902' },
                    { text: '运河区', value: '130903' },
                    { text: '沧县', value: '130921' }
                ]
            },
            {
                text: '廊坊市',
                value: '131000',
                children: [
                    { text: '安次区', value: '131002' },
                    { text: '广阳区', value: '131003' },
                    { text: '固安县', value: '131022' }
                ]
            },
            {
                text: '衡水市',
                value: '131100',
                children: [
                    { text: '桃城区', value: '131102' },
                    { text: '冀州区', value: '131103' }
                ]
            }
        ]
    },
    {
        text: '山西省',
        value: '140000',
        children: [
            {
                text: '太原市',
                value: '140100',
                children: [
                    { text: '小店区', value: '140105' },
                    { text: '迎泽区', value: '140106' },
                    { text: '杏花岭区', value: '140107' },
                    { text: '尖草坪区', value: '140108' },
                    { text: '万柏林区', value: '140109' },
                    { text: '晋源区', value: '140110' }
                ]
            },
            {
                text: '大同市',
                value: '140200',
                children: [
                    { text: '新荣区', value: '140212' },
                    { text: '平城区', value: '140213' },
                    { text: '云冈区', value: '140214' },
                    { text: '云州区', value: '140215' }
                ]
            },
            {
                text: '阳泉市',
                value: '140300',
                children: [
                    { text: '城区', value: '140302' },
                    { text: '矿区', value: '140303' },
                    { text: '郊区', value: '140311' }
                ]
            },
            {
                text: '长治市',
                value: '140400',
                children: [
                    { text: '潞州区', value: '140403' },
                    { text: '上党区', value: '140404' },
                    { text: '屯留区', value: '140405' },
                    { text: '潞城区', value: '140406' }
                ]
            },
            {
                text: '晋城市',
                value: '140500',
                children: [
                    { text: '城区', value: '140502' },
                    { text: '沁水县', value: '140521' },
                    { text: '阳城县', value: '140522' }
                ]
            },
            {
                text: '朔州市',
                value: '140600',
                children: [
                    { text: '朔城区', value: '140602' },
                    { text: '平鲁区', value: '140603' }
                ]
            },
            {
                text: '晋中市',
                value: '140700',
                children: [
                    { text: '榆次区', value: '140702' },
                    { text: '太谷区', value: '140703' }
                ]
            },
            {
                text: '运城市',
                value: '140800',
                children: [
                    { text: '盐湖区', value: '140802' }
                ]
            },
            {
                text: '忻州市',
                value: '140900',
                children: [
                    { text: '忻府区', value: '140902' }
                ]
            },
            {
                text: '临汾市',
                value: '141000',
                children: [
                    { text: '尧都区', value: '141002' }
                ]
            },
            {
                text: '吕梁市',
                value: '141100',
                children: [
                    { text: '离石区', value: '141102' }
                ]
            }
        ]
    },
    {
        text: '内蒙古自治区',
        value: '150000',
        children: [
            {
                text: '呼和浩特市',
                value: '150100',
                children: [
                    { text: '新城区', value: '150102' },
                    { text: '回民区', value: '150103' },
                    { text: '玉泉区', value: '150104' },
                    { text: '赛罕区', value: '150105' }
                ]
            },
            {
                text: '包头市',
                value: '150200',
                children: [
                    { text: '东河区', value: '150202' },
                    { text: '昆都仑区', value: '150203' },
                    { text: '青山区', value: '150204' },
                    { text: '石拐区', value: '150205' },
                    { text: '白云鄂博矿区', value: '150206' },
                    { text: '九原区', value: '150207' }
                ]
            },
            {
                text: '乌海市',
                value: '150300',
                children: [
                    { text: '海勃湾区', value: '150302' },
                    { text: '海南区', value: '150303' },
                    { text: '乌达区', value: '150304' }
                ]
            },
            {
                text: '赤峰市',
                value: '150400',
                children: [
                    { text: '红山区', value: '150402' },
                    { text: '元宝山区', value: '150403' },
                    { text: '松山区', value: '150404' }
                ]
            },
            {
                text: '通辽市',
                value: '150500',
                children: [
                    { text: '科尔沁区', value: '150502' }
                ]
            },
            {
                text: '鄂尔多斯市',
                value: '150600',
                children: [
                    { text: '东胜区', value: '150602' },
                    { text: '康巴什区', value: '150603' }
                ]
            },
            {
                text: '呼伦贝尔市',
                value: '150700',
                children: [
                    { text: '海拉尔区', value: '150702' },
                    { text: '扎赉诺尔区', value: '150703' }
                ]
            },
            {
                text: '巴彦淖尔市',
                value: '150800',
                children: [
                    { text: '临河区', value: '150802' }
                ]
            },
            {
                text: '乌兰察布市',
                value: '150900',
                children: [
                    { text: '集宁区', value: '150902' }
                ]
            }
        ]
    },
    {
        text: '辽宁省',
        value: '210000',
        children: [
            {
                text: '沈阳市',
                value: '210100',
                children: [
                    { text: '和平区', value: '210102' },
                    { text: '沈河区', value: '210103' },
                    { text: '大东区', value: '210104' },
                    { text: '皇姑区', value: '210105' },
                    { text: '铁西区', value: '210106' },
                    { text: '苏家屯区', value: '210111' },
                    { text: '浑南区', value: '210112' },
                    { text: '沈北新区', value: '210113' },
                    { text: '于洪区', value: '210114' },
                    { text: '辽中区', value: '210115' }
                ]
            },
            {
                text: '大连市',
                value: '210200',
                children: [
                    { text: '中山区', value: '210202' },
                    { text: '西岗区', value: '210203' },
                    { text: '沙河口区', value: '210204' },
                    { text: '甘井子区', value: '210211' },
                    { text: '旅顺口区', value: '210212' },
                    { text: '金州区', value: '210213' },
                    { text: '普兰店区', value: '210214' }
                ]
            },
            {
                text: '鞍山市',
                value: '210300',
                children: [
                    { text: '铁东区', value: '210302' },
                    { text: '铁西区', value: '210303' },
                    { text: '立山区', value: '210304' },
                    { text: '千山区', value: '210311' }
                ]
            },
            {
                text: '抚顺市',
                value: '210400',
                children: [
                    { text: '新抚区', value: '210402' },
                    { text: '东洲区', value: '210403' },
                    { text: '望花区', value: '210404' },
                    { text: '顺城区', value: '210411' }
                ]
            },
            {
                text: '本溪市',
                value: '210500',
                children: [
                    { text: '平山区', value: '210502' },
                    { text: '溪湖区', value: '210503' },
                    { text: '明山区', value: '210504' },
                    { text: '南芬区', value: '210505' }
                ]
            },
            {
                text: '丹东市',
                value: '210600',
                children: [
                    { text: '元宝区', value: '210602' },
                    { text: '振兴区', value: '210603' },
                    { text: '振安区', value: '210604' }
                ]
            },
            {
                text: '锦州市',
                value: '210700',
                children: [
                    { text: '古塔区', value: '210702' },
                    { text: '凌河区', value: '210703' },
                    { text: '太和区', value: '210711' },
                    { text: '凌海市', value: '210781' }
                ]
            },
            {
                text: '营口市',
                value: '210800',
                children: [
                    { text: '站前区', value: '210802' },
                    { text: '西市区', value: '210803' },
                    { text: '鲅鱼圈区', value: '210804' },
                    { text: '老边区', value: '210811' }
                ]
            },
            {
                text: '阜新市',
                value: '210900',
                children: [
                    { text: '海州区', value: '210902' },
                    { text: '新邱区', value: '210903' },
                    { text: '太平区', value: '210904' },
                    { text: '清河门区', value: '210905' },
                    { text: '细河区', value: '210911' }
                ]
            },
            {
                text: '辽阳市',
                value: '211000',
                children: [
                    { text: '白塔区', value: '211002' },
                    { text: '文圣区', value: '211003' },
                    { text: '宏伟区', value: '211004' },
                    { text: '弓长岭区', value: '211005' },
                    { text: '太子河区', value: '211011' }
                ]
            },
            {
                text: '盘锦市',
                value: '211100',
                children: [
                    { text: '双台子区', value: '211102' },
                    { text: '兴隆台区', value: '211103' },
                    { text: '大洼区', value: '211104' }
                ]
            },
            {
                text: '铁岭市',
                value: '211200',
                children: [
                    { text: '银州区', value: '211202' },
                    { text: '清河区', value: '211204' }
                ]
            },
            {
                text: '朝阳市',
                value: '211300',
                children: [
                    { text: '双塔区', value: '211302' },
                    { text: '龙城区', value: '211303' }
                ]
            },
            {
                text: '葫芦岛市',
                value: '211400',
                children: [
                    { text: '连山区', value: '211402' },
                    { text: '龙港区', value: '211403' },
                    { text: '南票区', value: '211404' }
                ]
            }
        ]
    },
    {
        text: '吉林省',
        value: '220000',
        children: [
            {
                text: '长春市',
                value: '220100',
                children: [
                    { text: '南关区', value: '220102' },
                    { text: '宽城区', value: '220103' },
                    { text: '朝阳区', value: '220104' },
                    { text: '二道区', value: '220105' },
                    { text: '绿园区', value: '220106' },
                    { text: '双阳区', value: '220112' },
                    { text: '九台区', value: '220113' }
                ]
            },
            {
                text: '吉林市',
                value: '220200',
                children: [
                    { text: '昌邑区', value: '220202' },
                    { text: '龙潭区', value: '220203' },
                    { text: '船营区', value: '220204' },
                    { text: '丰满区', value: '220211' }
                ]
            },
            {
                text: '四平市',
                value: '220300',
                children: [
                    { text: '铁西区', value: '220302' },
                    { text: '铁东区', value: '220303' }
                ]
            },
            {
                text: '辽源市',
                value: '220400',
                children: [
                    { text: '龙山区', value: '220402' },
                    { text: '西安区', value: '220403' }
                ]
            },
            {
                text: '通化市',
                value: '220500',
                children: [
                    { text: '东昌区', value: '220502' },
                    { text: '二道江区', value: '220503' }
                ]
            },
            {
                text: '白山市',
                value: '220600',
                children: [
                    { text: '浑江区', value: '220602' },
                    { text: '江源区', value: '220605' }
                ]
            },
            {
                text: '松原市',
                value: '220700',
                children: [
                    { text: '宁江区', value: '220702' }
                ]
            },
            {
                text: '白城市',
                value: '220800',
                children: [
                    { text: '洮北区', value: '220802' }
                ]
            }
        ]
    },
    {
        text: '黑龙江省',
        value: '230000',
        children: [
            {
                text: '哈尔滨市',
                value: '230100',
                children: [
                    { text: '道里区', value: '230102' },
                    { text: '南岗区', value: '230103' },
                    { text: '道外区', value: '230104' },
                    { text: '平房区', value: '230108' },
                    { text: '松北区', value: '230109' },
                    { text: '香坊区', value: '230110' },
                    { text: '呼兰区', value: '230111' },
                    { text: '阿城区', value: '230112' },
                    { text: '双城区', value: '230113' }
                ]
            },
            {
                text: '齐齐哈尔市',
                value: '230200',
                children: [
                    { text: '龙沙区', value: '230202' },
                    { text: '建华区', value: '230203' },
                    { text: '铁锋区', value: '230204' },
                    { text: '昂昂溪区', value: '230205' },
                    { text: '富拉尔基区', value: '230206' },
                    { text: '碾子山区', value: '230207' },
                    { text: '梅里斯达斡尔族区', value: '230208' }
                ]
            },
            {
                text: '鸡西市',
                value: '230300',
                children: [
                    { text: '鸡冠区', value: '230302' },
                    { text: '恒山区', value: '230303' },
                    { text: '滴道区', value: '230304' },
                    { text: '梨树区', value: '230305' },
                    { text: '城子河区', value: '230306' },
                    { text: '麻山区', value: '230307' }
                ]
            },
            {
                text: '鹤岗市',
                value: '230400',
                children: [
                    { text: '向阳区', value: '230402' },
                    { text: '工农区', value: '230403' },
                    { text: '南山区', value: '230404' },
                    { text: '兴安区', value: '230405' },
                    { text: '东山区', value: '230406' },
                    { text: '兴山区', value: '230407' }
                ]
            },
            {
                text: '双鸭山市',
                value: '230500',
                children: [
                    { text: '尖山区', value: '230502' },
                    { text: '岭东区', value: '230503' },
                    { text: '四方台区', value: '230505' },
                    { text: '宝山区', value: '230506' }
                ]
            },
            {
                text: '大庆市',
                value: '230600',
                children: [
                    { text: '萨尔图区', value: '230602' },
                    { text: '龙凤区', value: '230603' },
                    { text: '让胡路区', value: '230604' },
                    { text: '红岗区', value: '230605' },
                    { text: '大同区', value: '230606' }
                ]
            },
            {
                text: '伊春市',
                value: '230700',
                children: [
                    { text: '伊美区', value: '230717' },
                    { text: '乌翠区', value: '230718' },
                    { text: '友好区', value: '230719' },
                    { text: '金林区', value: '230720' }
                ]
            },
            {
                text: '佳木斯市',
                value: '230800',
                children: [
                    { text: '向阳区', value: '230803' },
                    { text: '前进区', value: '230804' },
                    { text: '东风区', value: '230805' },
                    { text: '郊区', value: '230811' }
                ]
            },
            {
                text: '七台河市',
                value: '230900',
                children: [
                    { text: '新兴区', value: '230902' },
                    { text: '桃山区', value: '230903' },
                    { text: '茄子河区', value: '230904' }
                ]
            },
            {
                text: '牡丹江市',
                value: '231000',
                children: [
                    { text: '东安区', value: '231002' },
                    { text: '阳明区', value: '231003' },
                    { text: '爱民区', value: '231004' },
                    { text: '西安区', value: '231005' }
                ]
            },
            {
                text: '黑河市',
                value: '231100',
                children: [
                    { text: '爱辉区', value: '231102' }
                ]
            },
            {
                text: '绥化市',
                value: '231200',
                children: [
                    { text: '北林区', value: '231202' }
                ]
            }
        ]
    },
    {
        text: '上海市',
        value: '310000',
        children: [
            {
                text: '上海市',
                value: '310100',
                children: [
                    { text: '黄浦区', value: '310101' },
                    { text: '徐汇区', value: '310104' },
                    { text: '长宁区', value: '310105' },
                    { text: '静安区', value: '310106' },
                    { text: '普陀区', value: '310107' },
                    { text: '虹口区', value: '310109' },
                    { text: '杨浦区', value: '310110' },
                    { text: '闵行区', value: '310112' },
                    { text: '宝山区', value: '310113' },
                    { text: '嘉定区', value: '310114' },
                    { text: '浦东新区', value: '310115' },
                    { text: '金山区', value: '310116' },
                    { text: '松江区', value: '310117' },
                    { text: '青浦区', value: '310118' },
                    { text: '奉贤区', value: '310120' },
                    { text: '崇明区', value: '310151' }
                ]
            }
        ]
    },
    {
        text: '江苏省',
        value: '320000',
        children: [
            {
                text: '南京市',
                value: '320100',
                children: [
                    { text: '玄武区', value: '320102' },
                    { text: '秦淮区', value: '320104' },
                    { text: '建邺区', value: '320105' },
                    { text: '鼓楼区', value: '320106' },
                    { text: '浦口区', value: '320111' },
                    { text: '栖霞区', value: '320113' },
                    { text: '雨花台区', value: '320114' },
                    { text: '江宁区', value: '320115' },
                    { text: '六合区', value: '320116' },
                    { text: '溧水区', value: '320117' },
                    { text: '高淳区', value: '320118' }
                ]
            },
            {
                text: '无锡市',
                value: '320200',
                children: [
                    { text: '锡山区', value: '320205' },
                    { text: '惠山区', value: '320206' },
                    { text: '滨湖区', value: '320211' },
                    { text: '梁溪区', value: '320213' },
                    { text: '新吴区', value: '320214' }
                ]
            },
            {
                text: '徐州市',
                value: '320300',
                children: [
                    { text: '鼓楼区', value: '320302' },
                    { text: '云龙区', value: '320303' },
                    { text: '贾汪区', value: '320305' },
                    { text: '泉山区', value: '320311' },
                    { text: '铜山区', value: '320312' }
                ]
            },
            {
                text: '常州市',
                value: '320400',
                children: [
                    { text: '天宁区', value: '320402' },
                    { text: '钟楼区', value: '320404' },
                    { text: '新北区', value: '320411' },
                    { text: '武进区', value: '320412' },
                    { text: '金坛区', value: '320413' }
                ]
            },
            {
                text: '苏州市',
                value: '320500',
                children: [
                    { text: '虎丘区', value: '320505' },
                    { text: '吴中区', value: '320506' },
                    { text: '相城区', value: '320507' },
                    { text: '姑苏区', value: '320508' },
                    { text: '吴江区', value: '320509' }
                ]
            },
            {
                text: '南通市',
                value: '320600',
                children: [
                    { text: '崇川区', value: '320602' },
                    { text: '港闸区', value: '320611' },
                    { text: '通州区', value: '320612' }
                ]
            },
            {
                text: '连云港市',
                value: '320700',
                children: [
                    { text: '连云区', value: '320703' },
                    { text: '海州区', value: '320706' },
                    { text: '赣榆区', value: '320707' }
                ]
            },
            {
                text: '淮安市',
                value: '320800',
                children: [
                    { text: '淮安区', value: '320803' },
                    { text: '淮阴区', value: '320804' },
                    { text: '清江浦区', value: '320812' },
                    { text: '洪泽区', value: '320813' }
                ]
            },
            {
                text: '盐城市',
                value: '320900',
                children: [
                    { text: '亭湖区', value: '320902' },
                    { text: '盐都区', value: '320903' },
                    { text: '大丰区', value: '320904' }
                ]
            },
            {
                text: '扬州市',
                value: '321000',
                children: [
                    { text: '广陵区', value: '321002' },
                    { text: '邗江区', value: '321003' },
                    { text: '江都区', value: '321012' }
                ]
            },
            {
                text: '镇江市',
                value: '321100',
                children: [
                    { text: '京口区', value: '321102' },
                    { text: '润州区', value: '321111' },
                    { text: '丹徒区', value: '321112' }
                ]
            },
            {
                text: '泰州市',
                value: '321200',
                children: [
                    { text: '海陵区', value: '321202' },
                    { text: '高港区', value: '321203' },
                    { text: '姜堰区', value: '321204' }
                ]
            },
            {
                text: '宿迁市',
                value: '321300',
                children: [
                    { text: '宿城区', value: '321302' },
                    { text: '宿豫区', value: '321311' }
                ]
            }
        ]
    }
])

// Picker 变化事件
const onPickerChange = (values: string[]) => {
    selectedValues.value = values
}

// Picker 确认事件
const onPickerConfirm = (values: string[]) => {
    selectedValues.value = values
    handleConfirm()
}

// Picker 取消事件
const onPickerCancel = () => {
    handleCancel()
}

// 处理确认
const handleConfirm = () => {
    let regionText = ''

    if (selectedValues.value.length >= 3) {
        regionText = selectedValues.value.join(' ')
    } else if (selectedValues.value.length >= 2) {
        regionText = selectedValues.value.join(' ')
    } else if (selectedValues.value.length >= 1) {
        regionText = selectedValues.value[0]
    }

    emit('confirm', regionText)
    visible.value = false
}

// 处理取消
const handleCancel = () => {
    visible.value = false
}

// 监听弹窗显示，重置选择状态
watch(visible, (newVal) => {
    if (newVal) {
        // 重置选择状态
        selectedValues.value = []
    }
})
</script>

<style scoped>
/* 移除所有自定义样式，使用 Vant 默认样式 */
</style>